<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>预警系统-耗时告警</title>
<link rel="stylesheet" type="text/css"
	href="/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="/themes/icon.css">
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/js/eui_manager.js"></script>
<script type="text/javascript" src="/js/util.js"></script>
</head>
<body>
	<ul id="nav"></ul>
	<div id="cc" class="easyui-layout" style="width: 100%; height: 700px;">
		<div data-options="region:'center'">
			<table id="dg"></table>
		</div>
	</div>
	<div id="tb" style="height: auto;">
		<div style="margin: 10px;">
			<a href="javascript:void(0)" class="easyui-linkbutton"
				data-options="iconCls:'icon-add',plain:true"
				onclick="action.insert()">添加</a> <input id="keyword"
				class="easyui-searchbox" searcher="doSearch" prompt="请输入关键字 "
				style="vertical-align: middle;"></input>
		</div
	</div>

	<script type="text/javascript">
		var url = '/ui/';
		var tbl = $('#dg');
		var clsName = 'com.itrip.log.module.db.domain.MethodAlarmBean';
		var action = new UIAction(tbl, clsName, url, getFormVal);

		function getFormVal() {
			var arr = {
				'keyword' : $('#keyword').searchbox('getValue'),
			};
			return arr;
		}

		function doSearch() {
			$('#dg').datagrid('reload');
		}

		$(function() {

			var grp = $.ajax({
				url : "/ui/select?id=queryUserGroup",
				async : false
			}).responseJSON;

			var classify = $.ajax({
				url : "/ui/select?id=queryClassify",
				async : false
			}).responseJSON;

			var process = $.ajax({
				url : "/ui/select?id=queryProcess",
				async : false
			}).responseJSON;

			var columns = [ [ {
				field : 'id',
				title : 'ID',
				width : '10%',
			}, {
				field : 'type',
				title : '类别',
				width : '10%',
				editor : {
					type : 'combobox',
					options : {
						data : classify,
						editable:false,
						textField : "value",
						valueField : "key",
					}
				}
			}, {
				field : 'proc',
				title : '进程',
				width : '10%',
				editor : {
					type : 'combobox',
					options : {
						data : process,
						editable:false,
						textField : "value",
						valueField : "key",
					/*panelHeight : "auto",*/
					}
				}
			}, {
				field : 'service',
				title : '服务',
				width : '10%',
				editor : 'textbox'
			}, {
				field : 'method',
				title : '方法',
				width : '10%',
				editor : 'textbox'
			}, {
				field : 'timeThreshold',
				title : '耗时阈值',
				width : '10%',
				editor : 'numberbox'
			}, {
				field : 'requestCount',
				title : '请求次数',
				width : '10%',
				editor : 'numberbox'
			}, {
				field : 'period',
				title : '统计周期',
				width : '10%',
				editor : 'numberbox'
			}, {
				field : 'emailGroup',
				title : '邮件组',
				width : '10%',
				editor : {
					type : 'combobox',
					editable : "false",
					options : {
						data : grp,
						editable:false,
						textField : "name",
						valueField : "name",
					}
				}
			}, {
				field : 'action',
				title : '操作',
				width : '10%',
				formatter : action.buildAction
			} ] ];

			initNavMenu('#nav');
			action.configTable('#tb', columns);
		})
	</script>
</body>
</html>
